class Http{
    static  baseUrl ="http://47.108.197.28:3000"
    static request(url){
        return new Promise((resolve,reject)=>{
            $.ajax({
                url:this.baseUrl+url,
                success:res=>{
                    resolve(res)
                },
                error:err=>{
                    reject(err);
                }
            })
        })
    }
}
/* 
热门歌曲  /top/playlist/highquality
最新音乐 /album/newest  
主播电台  /personalized/djprogram    
 */
class MusicHttp  extends Http{
    static getHotMusicHttp(){
        return  this.request("/top/playlist/highquality")
    }
    static getNewMusicHttp(){
        return this.request("/album/newest")
    }
    static getDjHttp(){
        return this.request("/personalized/djprogram")
    }
}
module.exports = MusicHttp;